<template>
	<view class="index-view">
		<view class="top-bar"><uni-navbar :fixed="true" :back="false" color="#fff" :title="title"></uni-navbar></view>

		<view class="banner"><u-swiper :list="swiperList" mode="none" height="280" @click="swiperClick"></u-swiper></view>

		<block v-if="userInfo.username && !userInfo.userInfo.nickName">
			<view class="com-h3" v-if="$sysMenus('index_bgpt')">办公平台</view>
			<view class="index-card" v-if="$sysMenus('index_bgpt')">
				<u-row class="card-link" gutter="0" align="top">
					<u-col span="3">
						<view class="link-item" @click="navTo('/pagesB/notice2/list')">
							<u-badge :count="tzggNum" :offset="[-10, 30]" slot="right-icon"></u-badge>
							<image class="image inimage" src="/static/zzgg.png" mode="aspectFill"></image>
							通知办理
						</view>
					</u-col>
					<u-col span="3">
						<view class="link-item" @click="navTo('/pagesA/question/list')">
							<u-badge :count="dcwjNum" :offset="[-10, 30]" slot="right-icon"></u-badge>
							<image class="image" src="/static/img/home_icon_48.png" mode="aspectFill"></image>
							调查问卷
						</view>
					</u-col>
					<u-col span="3">
						<view class="link-item" @click="navTo('/pagesA/voting/list')">
							<u-badge :count="dztpNum" :offset="[-10, 30]" slot="right-icon"></u-badge>
							<image class="image" src="/static/img/home_icon_47.png" mode="aspectFill"></image>
							电子投票
						</view>
					</u-col>

					<u-col span="3" v-if="$sysMenus('hyhd')">
						<view class="link-item" @click="navTo('/pagesB/meeting/index')">
							<image class="image" src="/static/img/home_icon_35.png" mode="aspectFill"></image>
							会议活动
						</view>
					</u-col>
					<u-col span="3" v-if="$sysMenus('scan')">
						<view class="link-item" @click="scan()">
							<image class="image" src="/static/img/home_icon_36.png" mode="aspectFill"></image>
							扫码签到
						</view>
					</u-col>
				</u-row>
			</view>

			<view class="p-popup" v-if="show" @click="show = false">
				<view class="image-box">
					<view class="bg-image"><image class="image" src="/static/img/bg-p_02.png" mode="widthFix"></image></view>
					<view class="content">
						<view class="title clamp2">{{ meetingInfo.title }}</view>
						<view class="name clamp">姓名：{{ meetingInfo.userName }}</view>
						<view class="info">
							<view class="text" v-show="meetingInfo.seatNo != '暂无安排'">座位信息：{{ $htmlRegx(meetingInfo.seatNo) }}</view>
							<view class="text" v-show="meetingInfo.carNo != '暂无安排'">车辆信息：{{ $htmlRegx(meetingInfo.carNo) }}</view>
							<view class="text" v-show="meetingInfo.hotelNo != '暂无安排'">房间信息：{{ $htmlRegx(meetingInfo.hotelNo) }}</view>
							<view class="text" v-show="meetingInfo.dinnerInfo != '暂无安排'">就餐信息：{{ $htmlRegx(meetingInfo.dinnerInfo) }}</view>
							<!-- <view class="text" v-show="!meetingInfo.firstSign && meetingInfo.signTime">签到时间：{{ meetingInfo.signTime }}</view> -->
						</view>

						<view class="btn"><image class="image" src="/static/img/bg-p_04.png" mode="widthFix"></image></view>
					</view>
				</view>
			</view>
			<view class="p-popup" v-if="show2" @click="show2 = false">
				<view class="image-box">
					<view class="bg-image"><image class="image" src="/static/img/bg-p_02.png" mode="widthFix"></image></view>
					<view class="content">
						<view class="title clamp2">{{ `请勿重复扫码` }}</view>

						<view class="btn"><image class="image" src="/static/img/bg-p_04.png" mode="widthFix"></image></view>
					</view>
				</view>
			</view>

			<view class="com-h3" v-if="$sysMenus('index_slyj')">三联一进</view>
			<view class="index-card" v-if="$sysMenus('index_slyj')">
				<u-row class="card-link" gutter="0" align="top">
					<u-col span="3" v-if="$sysMenus('slyj_db_wt')">
						<view class="link-item" @click="navTo('/pagesB/cwhzcrylxrddb/index/index')">
							<image class="image" src="/static/img/home_icon_01.png" mode="aspectFill"></image>
							常委会组成人员
							<br />
							联系代表
						</view>
					</u-col>
					<u-col span="3" v-if="$sysMenus('lxcw') && !$sysMenus('slyj_db_wt')">
						<view class="link-item" @click="navTo('/pagesB/will/list_lxcw')">
							<image class="image" src="/static/img/home_icon_05.png" mode="aspectFill"></image>
							常委会组成人员
							<br />
							联系代表
						</view>
					</u-col>
					<u-col span="3" v-if="$sysMenus('slyj_zw1')">
						<view class="link-item" @click="navTo('/pagesA/lxHyxz/index')">
							<image class="image" src="/static/img/home_icon_02.png" mode="aspectFill"></image>
							专委会
							<br />
							联系行业小组
						</view>
					</u-col>
					<u-col span="3" v-if="$sysMenus('slyj_qz1')">
						<view class="link-item" @click="navTo('/pagesB/will/list')">
							<image class="image" src="/static/img/home_icon_03.png" mode="aspectFill"></image>
							人大代表
							<br />
							联系选民群众
						</view>
					</u-col>
					<u-col span="3" v-if="$sysMenus('slyj_wg1')">
						<view class="link-item" @click="navTo('/pagesA/lxWg/index')">
							<image class="image" src="/static/img/home_icon_04.png" mode="aspectFill"></image>
							人大代表
							<br />
							进网格
						</view>
					</u-col>
					<u-col span="3" v-if="$sysMenus('slyj_gzwj')">
						<view class="link-item" @click="navTo('/pagesA/file/list')">
							<image class="image" src="/static/img/home_icon_06.png" mode="aspectFill"></image>
							工作文件
						</view>
					</u-col>
				</u-row>
			</view>

			<view class="com-h3" v-if="$sysMenus('index_yajy')">议案建议</view>
			<view class="index-card" v-if="$sysMenus('index_yajy')">
				<u-row class="card-link" gutter="0" align="top">
					<u-col span="3" v-if="$sysMenus('yajy')">
						<view class="link-item" @click="navTo('/pagesB/propose/index')">
							<image class="image" src="/static/img/home_icon_29.png" mode="aspectFill"></image>
							议案管理
						</view>
					</u-col>
					<u-col span="3" v-if="$sysMenus('tabl')">
						<view class="link-item" @click="navTo('/pagesB/proposal/index')">
							<image class="image" src="/static/img/home_icon_30.png" mode="aspectFill"></image>
							建议办理
						</view>
					</u-col>
				</u-row>
			</view>

			<view class="com-h3" v-if="$sysMenus('index_lvpj')">履职评价</view>
			<view class="index-card" v-if="$sysMenus('index_lvpj')">
				<u-row class="card-link" gutter="0" align="top">
					<u-col span="3" v-if="$sysMenus('perform_jgws')">
						<view class="link-item" @click="navTo('/pagesA/duties/jgws')">
							<image class="image" src="/static/img/home_icon_44.png" mode="aspectFill"></image>
							机关各委室
							<br />
							履职管理
						</view>
					</u-col>
					<u-col span="3" v-if="$sysMenus('perform_hyxz')">
						<view class="link-item" @click="navTo('/pagesA/duties/wyhdz')">
							<image class="image" src="/static/img/home_icon_21.png" mode="aspectFill"></image>
							行业小组
							<br />
							履职管理
						</view>
					</u-col>
					<u-col span="3" v-if="$sysMenus('perform_dbzj')">
						<view class="link-item" @click="navTo('/pagesA/duties/dbzj')">
							<image class="image" src="/static/img/home_icon_22.png" mode="aspectFill"></image>
							代表之家
							<br />
							履职管理
						</view>
					</u-col>
					<u-col span="3" v-if="$sysMenus('perform_db')">
						<view class="link-item" @click="perform()">
							<image class="image" src="/static/img/home_icon_23.png" mode="aspectFill"></image>
							代表
							<br />
							履职管理
						</view>
					</u-col>
					<u-col span="3" v-if="$sysMenus('dagl')">
						<view class="link-item" @click="navTo('/pagesB/united/index')">
							<image class="image" src="/static/img/home_icon_24.png" mode="aspectFill"></image>
							档案管理
						</view>
					</u-col>
				</u-row>
			</view>

			<view class="com-h3" v-if="$sysMenus('index_mymsj')">民意码上聚</view>
			<view class="index-card" v-if="$sysMenus('index_mymsj')">
				<u-row class="card-link" gutter="0" align="top">
					<u-col span="3">
						<view class="link-item" @click="ytperform('ytxs')">
							<image class="image" src="/static/img/home_icon_13.png" mode="aspectFill"></image>
							议题征集
						</view>
					</u-col>

					<u-col span="3">
						<view class="link-item" @click="ytperform('ytgk')">
							<image class="image" src="/static/img/home_icon_14.png" mode="aspectFill"></image>
							码上留言
						</view>
					</u-col>

					<u-col span="3">
						<view class="link-item" @click="ytperform('msxs')">
							<image class="image" src="/static/img/home_icon_15.png" mode="aspectFill"></image>
							码上议事
						</view>
					</u-col>

					<u-col span="3">
						<view class="link-item" @click="ytperform('jggk')">
							<image class="image" src="/static/img/home_icon_16.png" mode="aspectFill"></image>
							码上公开
						</view>
					</u-col>

					<!-- <u-col span="3">
						<view class="link-item" @click="ytperform('yttj')">
							<image class="image" src="/static/img/home_icon_17.png" mode="aspectFill"></image>
							议题统计
						</view>
					</u-col> -->
				</u-row>
			</view>

			<view class="com-h3" v-if="$sysMenus('index_xwxc')">新闻宣传</view>
			<view class="index-card">
				<u-row class="card-link" gutter="0" align="top">
					<u-col span="3" v-if="$sysMenus('gzdtwz')">
						<view class="link-item" @click="newsTo('https://zxtemp.tanghecms.com/zcrd_web/?m=home&c=Lists&a=index&tid=30')">
							<image class="image" src="/static/img/home_icon_26.png" mode="aspectFill"></image>
							工作动态
						</view>
					</u-col>
					<u-col span="3" v-if="$sysMenus('zyzxwz')">
						<view class="link-item" @click="newsTo('https://zxtemp.tanghecms.com/zcrd_web/?m=home&c=Lists&a=index&tid=31')">
							<image class="image" src="/static/img/home_icon_27.png" mode="aspectFill"></image>
							重要资讯
						</view>
					</u-col>
					<u-col span="3" v-if="$sysMenus('zqzzwz')">
						<view class="link-item" @click="newsTo('https://zxtemp.tanghecms.com/zcrd_web/?m=home&c=Lists&a=index&tid=32')">
							<image class="image" src="/static/img/home_icon_28.png" mode="aspectFill"></image>
							知情知政
						</view>
					</u-col>
					<u-col span="3" v-if="$sysMenus('mtfgwz')">
						<view class="link-item" @click="navTo('/pagesA/duties/list?flag=&code=28,35,404&name=媒体宣传&currentUserId=-1')">
							<image class="image" src="/static/img/home_icon_45.png" mode="aspectFill"></image>
							媒体宣传
						</view>
					</u-col>
				</u-row>
			</view>

			<view class="com-h3" v-if="$sysMenus('index_xxpx')">学习培训</view>
			<view class="index-card">
				<u-row class="card-link" gutter="0" align="top">
					<u-col span="3" v-if="$sysMenus('xxpx')">
						<view class="link-item" @click="navTo('/pagesB/xuexi/list_video?type=4&secType=1&title=视频资料')">
							<image class="image" src="/static/img/home_icon_31.png" mode="aspectFill"></image>
							视频资料
						</view>
					</u-col>
					<u-col span="3" v-if="$sysMenus('xxpx')">
						<view class="link-item" @click="navTo('/pagesB/xuexi/list?type=1&secType=2&articleType=1&title=领导重要讲话')">
							<image class="image" src="/static/img/home_icon_31.png" mode="aspectFill"></image>
							领导重要讲话
						</view>
					</u-col>
					<u-col span="3" v-if="$sysMenus('xxpx')">
						<view class="link-item" @click="navTo('/pagesB/xuexi/list?type=1&secType=2&articleType=2&title=法律法规')">
							<image class="image" src="/static/img/home_icon_32.png" mode="aspectFill"></image>
							法律法规
						</view>
					</u-col>
					<u-col span="3" v-if="$sysMenus('xxpx')">
						<view class="link-item" @click="navTo('/pagesB/xuexi/list?type=1&secType=2&articleType=3&title=优秀建议')">
							<image class="image" src="/static/img/home_icon_33.png" mode="aspectFill"></image>
							优秀建议
						</view>
					</u-col>
					<u-col span="3" v-if="$sysMenus('xxpx')">
						<view class="link-item" @click="navTo('/pagesB/xuexi/list?type=1&secType=2&articleType=4&title=代表履职风采')">
							<image class="image" src="/static/img/home_icon_34.png" mode="aspectFill"></image>
							代表履职风采
						</view>
					</u-col>
				</u-row>
			</view>

			<view class="com-h3" v-if="$sysMenus('index_zxlm')">自选栏目</view>
			<view class="index-card">
				<u-row class="card-link" gutter="0" align="top">
					<u-col span="3" v-if="$sysMenus('wyfc')">
						<view class="link-item" @click="navTo('/pagesA/avenger/list?type=9&title=绘画')">
							<image class="image" src="/static/img/home_icon_38.png" mode="aspectFill"></image>
							绘画
						</view>
					</u-col>
					<u-col span="3" v-if="$sysMenus('wyfc')">
						<view class="link-item" @click="navTo('/pagesA/avenger/list?type=8&title=美文')">
							<image class="image" src="/static/img/home_icon_42.png" mode="aspectFill"></image>
							美文
						</view>
					</u-col>
					<u-col span="3" v-if="$sysMenus('wyfc')">
						<view class="link-item" @click="navTo('/pagesA/avenger/list?type=4&title=书法')">
							<image class="image" src="/static/img/home_icon_40.png" mode="aspectFill"></image>
							书法
						</view>
					</u-col>
					<u-col span="3" v-if="$sysMenus('wyfc')">
						<view class="link-item" @click="navTo('/pagesA/avenger/list?type=3&title=摄影')">
							<image class="image" src="/static/img/home_icon_41.png" mode="aspectFill"></image>
							摄影
						</view>
					</u-col>
					<u-col span="3" v-if="$sysMenus('wyfc')">
						<view class="link-item" @click="navTo('/pagesA/avenger/list?type=7&title=其他')">
							<image class="image" src="/static/img/home_icon_43.png" mode="aspectFill"></image>
							其他
						</view>
					</u-col>
				</u-row>
			</view>
		</block>
		<block v-else>
			
			<view class="com-h3">我要找代表</view>
			<view class="index-card">
				<u-row class="card-link" gutter="0" align="top">
					<u-col span="3">
						<view class="link-item" @click="ytperform('qztbwt')">
							<image class="image" src="/static/img/home_icon_14.png" mode="aspectFill"></image>
							提报问题
						</view>
					</u-col>

					<u-col span="3">
						<view class="link-item" @click="ytperform('qzwtlb')">
							<image class="image" src="/static/img/home_icon_08.png" mode="aspectFill"></image>
							问题列表
						</view>
					</u-col>
				</u-row>
			</view>

			<view class="com-h3">民意码上聚</view>
			<view class="index-card">
				<u-row class="card-link" gutter="0" align="top">
					<!-- <u-col span="3">
						<view class="link-item" @click="ytperform('qzmsxs')">
							<image class="image" src="/static/img/home_icon_15.png" mode="aspectFill"></image>
							码上议事
						</view>
					</u-col> -->

					<u-col span="3">
						<view class="link-item" @click="ytperform('qzmsly')">
							<image class="image" src="/static/img/home_icon_14.png" mode="aspectFill"></image>
							码上留言
						</view>
					</u-col>

					<u-col span="3">
						<view class="link-item" @click="ytperform('qzmsys')">
							<image class="image" src="/static/img/home_icon_15.png" mode="aspectFill"></image>
							码上议事
						</view>
					</u-col>

					<u-col span="3">
						<view class="link-item" @click="ytperform('qzmsgk')">
							<image class="image" src="/static/img/home_icon_16.png" mode="aspectFill"></image>
							码上公开
						</view>
					</u-col>
				</u-row>
			</view>
			
			<view class="com-h3">调查问卷</view>
			<view class="index-card">
				<u-row class="card-link" gutter="0" align="top">
					<u-col span="3">
						<view class="link-item" @click="navTo('/pagesA/question/list')">
							<u-badge :count="dcwjNum" :offset="[-10, 30]" slot="right-icon"></u-badge>
							<image class="image" src="/static/img/home_icon_48.png" mode="aspectFill"></image>
							调查问卷
						</view>
					</u-col>
				</u-row>
			</view>

			<!-- <view class="container" style="margin-top: 10rpx; background-color: #fff">
				<u-tabs class="uTabs" :list="tabList" bgColor="#fff" barWidth="84" barHeight="8" :is-scroll="false" :current="current" @change="tabsChange"></u-tabs>

				<block v-if="current == 0">
					<view class="list-box" :class="Gzdt.loading == 'nodata' ? 'nodata' : ''">
						<view class="list-info_02" v-for="(item, index) of Gzdt.list" :key="item.id" @click="navTo('/pagesA/comG/detail?id=' + item.id)">
							<view class="left">
								<view class="info-title">{{ item.title }}</view>
								<view class="info-btm">
									{{ item.pubName }}
									<text class="line"></text>
									{{ item.pubTime }}
								</view>
							</view>
							<view class="right"><image class="image" :src="$imgRegxF(item.content)" mode="aspectFill"></image></view>
						</view>

						<u-loadmore :status="Gzdt.loading" />
					</view>
				</block>
				<block v-if="current == 1">
					<view class="list-box" :class="Wyfc.loading == 'nodata' ? 'nodata' : ''">
						<view class="list-info_02" v-for="(item, index) of Wyfc.list" :key="item.id" @click="navTo('/pagesA/comW/detail?id=' + item.id)">
							<view class="left">
								<view class="info-title">{{ item.title }}</view>
								<view class="info-btm">
									{{ item.createByName }}
									<text class="line"></text>
									{{ item.pubDate }}
								</view>
							</view>
							<view class="right"><image class="image" :src="$imgRegxF(item.content)" mode="aspectFill"></image></view>
						</view>

						<u-loadmore :status="Wyfc.loading" />
					</view>
				</block>
				<block v-if="current == 2">
					<view class="list-box" :class="Zqzz.loading == 'nodata' ? 'nodata' : ''">
						<view class="list-info_02" v-for="(item, index) of Zqzz.list" :key="item.id" @click="navTo('/pagesA/comZ/detail?id=' + item.id)">
							<view class="left">
								<view class="info-title">{{ item.title }}</view>
								<view class="info-btm">
									{{ item.pubName }}
									<text class="line"></text>
									{{ item.pubTime }}
								</view>
							</view>
							<view class="right"><image class="image" :src="$imgRegxF(item.content)" mode="aspectFill"></image></view>
						</view>

						<u-loadmore :status="Zqzz.loading" />
					</view>
				</block>
			</view> -->
		</block>

		<view class="" style="height: 100upx"></view>
	</view>
</template>

<script>
import { mapState } from 'vuex';
export default {
	data() {
		return {
			tzggNum: 0,
			dcwjNum: 0,
			dztpNum: 0,
			iswy: false,
			show: false,
			show2: false,
			scrollTop: 0,
			title: '诸城人大代表履职通',
			text: '',
			list: [],
			swiperList: [
				{
					image: '/static/img/banner01.jpg'
				}
			],
			swiperImage: '/static/img/banner01.jpg',
			current: 0,
			announcements: {
				dataType: '1',
				title: ''
			},
			tabList: [
				{
					name: '联系情况',
					count: '0'
				},
				{
					name: '代表风采',
					count: '0'
				}
			],
			meetingInfo: {},
			Gzdt: {
				list: [],
				pageNum: 1,
				pageSize: 10,
				fnFlag: '2',
				dataType: '2',
				loaded: false,
				loading: 'loadmore'
			},
			Wyfc: {
				list: [],
				pageNum: 1,
				pageSize: 10,
				wyfc: {
					nodeStatus: '2',
					status: ''
				},
				loaded: false,
				loading: 'loadmore'
			},
			Zqzz: {
				list: [],
				pageNum: 1,
				pageSize: 10,
				fnFlag: '2',
				dataType: '1',
				loaded: false,
				loading: 'loadmore'
			}
		};
	},
	onLoad() {
		this.loadLogin();
		this.getBanner();
		this.getBaiduToken();

		// this.loadData();
		// let res = { type: 'huiyi', data: { id: 'bbc3d36fc4b6465eaf07778084999e1f' } };
		// this.qrcodeResult({
		// 	result: JSON.stringify(res)
		// });
	},
	onShow() {
		this.loadLogin();
		if (this.$roleCodes('weiyuan')) {
			this.iswy = true;
		} else {
			this.iswy = false;
		}
		this.tzggloadData();
		this.dcwjloadData();
		this.dztploadData();
	},
	onPullDownRefresh() {
		// this.loadData('refresh');
	},
	onShareAppMessage(res) {
		return {
			title: this.title,
			path: '/pages/index/index',
			imageUrl: '/static/img/share.png'
		};
	},
	onShareTimeline(res) {
		return {};
	},
	onReachBottom() {
		// if (this.current == 0 && this.Gzdt.loading == 'loadmore') this.loadGzdt('add');
		// if (this.current == 1 && this.Wyfc.loading == 'loadmore') this.loadWyfc('add');
		// if (this.current == 2 && this.Zqzz.loading == 'loadmore') this.loadZqzz('add');
	},
	onPageScroll(res) {
		this.scrollTop = res.scrollTop;
	},
	computed: {
		...mapState(['userInfo'])
	},
	methods: {
		loadLogin() {
			if (this.userInfo.Authorization) {
				this.clientCode = this.userInfo.sysUser.clientCode;
				this.roleCodes = this.userInfo.roleCodes.join(',');
				this.userId = this.userInfo.sysUser.id;

				this.wyhdz = this.userInfo.userInfo.wyhdz;
				this.dbzjId = this.userInfo.userInfo.dbzjId;
				this.title = `诸城人大代表履职通`;

				uni.setNavigationBarTitle({
					title: this.title
				});
			} else {
				// this.$logout();
			}
		},
		loadData(type = 'add') {
			// this.loadZqzz(type);
			this.loadGzdt(type);
			this.loadWyfc(type);
		},
		loadGzdt(type = 'add') {
			if (type == 'add') {
				if (this.Gzdt.loading == 'nomore') {
					return false;
				}
				this.Gzdt.loading = 'loading';
			} else {
				this.Gzdt.loading = 'loading';
			}
			if (type != 'add') {
				this.Gzdt.pageNum = 1;
			}
			let data = {
				pageNum: this.pageNum,
				pageSize: this.pageSize,
				clientCode: this.clientCode,
				title: this.title,
				openFlag: '1',
				dataType: '2'
			};
			this.$request('/contactGroup/msContactGroup/list', data).then((res) => {
				let count = 0;
				if (type != 'add') {
					uni.stopPullDownRefresh();
					this.Gzdt.list = [];
				}

				this.Gzdt.loading = this.Gzdt.pageNum < Math.ceil(res.data.total / this.Gzdt.pageSize) ? 'loadmore' : 'nomore';
				this.Gzdt.pageNum = this.Gzdt.pageNum + 1;
				this.Gzdt.list = this.Gzdt.list.concat(res.data.records);
				this.Gzdt.loaded = true;
				if (this.Gzdt.list.length <= 0) {
					this.Gzdt.loading = 'nodata';
				}
			});
		},
		loadWyfc(type = 'add') {
			if (type == 'add') {
				if (this.Wyfc.loading == 'nomore') {
					return false;
				}
				this.Wyfc.loading = 'loading';
			} else {
				this.Wyfc.loading = 'loading';
			}
			if (type != 'add') {
				this.Wyfc.pageNum = 1;
			}
			let data = {
				pageNum: this.Wyfc.pageNum,
				pageSize: this.Wyfc.pageSize,
				clientCode: this.clientCode,
				wyfc: this.Wyfc.wyfc
			};
			this.$request('/wyfc/list', data).then((res) => {
				let count = 0;
				if (type != 'add') {
					uni.stopPullDownRefresh();
					this.Wyfc.list = [];
				}

				this.Wyfc.loading = this.Wyfc.pageNum < Math.ceil(res.data.total / this.Wyfc.pageSize) ? 'loadmore' : 'nomore';
				this.Wyfc.pageNum = this.Wyfc.pageNum + 1;
				this.Wyfc.list = this.Wyfc.list.concat(res.data.records);
				this.Wyfc.loaded = true;
				if (this.Wyfc.list.length <= 0) {
					this.Wyfc.loading = 'nodata';
				}
			});
		},
		loadZqzz(type = 'add') {
			if (type == 'add') {
				if (this.Zqzz.loading == 'nomore') {
					return false;
				}
				this.Zqzz.loading = 'loading';
			} else {
				this.Zqzz.loading = 'loading';
			}
			if (type != 'add') {
				this.Zqzz.pageNum = 1;
			}
			let data = {
				pageNum: this.Zqzz.pageNum,
				pageSize: this.Zqzz.pageSize,
				clientCode: this.clientCode,
				dataType: this.Zqzz.dataType,
				fnFlag: this.Zqzz.fnFlag
			};
			this.$request('/tongzhigonggao/knowDP/list', data).then((res) => {
				let count = 0;
				if (type != 'add') {
					uni.stopPullDownRefresh();
					this.Zqzz.list = [];
				}

				this.Zqzz.loading = this.Zqzz.pageNum < Math.ceil(res.data.total / this.Zqzz.pageSize) ? 'loadmore' : 'nomore';
				this.Zqzz.pageNum = this.Zqzz.pageNum + 1;
				this.Zqzz.list = this.Zqzz.list.concat(res.data.records);
				this.Zqzz.loaded = true;
				if (this.Zqzz.list.length <= 0) {
					this.Zqzz.loading = 'nodata';
				}
			});
		},

		tzggloadData(type = 'add') {
			let that = this;

			let data = {
				pageNum: '1',
				pageSize: '10',
				currentUserId: this.userId,
				roleCodes: this.roleCodes,
				clientCode: this.clientCode,
				readStatus: '0',
				announcements: this.announcements
			};
			this.$request('/announcements/myList', data, {
				load: true
			}).then((res) => {
				that.tzggNum = res.data.total;
			});
		},
		dcwjloadData(type = 'add') {
			let that = this;

			let data = {
				currentUserId: this.userId,
				roleCodes: this.roleCodes,
				clientCode: this.clientCode
			};
			this.$request('/questionnaire/myAttend', data, {
				load: true
			}).then((res) => {
				that.dcwjNum = res.data.notNum;
			});
		},
		dztploadData(type = 'add') {
			let that = this;

			let data = {
				currentUserId: this.userId,
				roleCodes: this.roleCodes,
				clientCode: this.clientCode
			};
			this.$request('/voting/myAttend', data, {
				load: true
			}).then((res) => {
				that.dztpNum = res.data.notNum;
			});
		},
		getBaiduToken() {
			this.$request('/baidu/ttsToken', {
				clientCode: this.clientCode,
				userId: this.userId
			}).then((res) => {
				uni.setStorageSync('baiduToken', res.data);
			});
		},
		getBanner() {
			this.$request('/banner/list', {
				clientCode: this.clientCode,
				userId: this.userId,
				banner: {
					enable: '1'
				}
			}).then((res) => {
				if (!res.data) {
					return false;
				}
				this.swiperList = [];
				res.data.records.forEach((item) => {
					if (item.fileList && item.fileList.length > 0) {
						this.swiperList.push({
							id: item.id,
							title: item.title,
							url: item.externalLink,
							image: this.$imagePreview(item.fileList[0].path)
						});
					}
				});
				uni.setStorageSync('swiperList', this.swiperList);
			});
		},
		ytperform(e) {
			if (!this.userInfo.sysUser) {
				this.$store.commit('logout');
				uni.showModal({
					title: '提示',
					content: '请先登录？',
					success: (res) => {
						if (res.confirm) {
							uni.navigateTo({
								url: '/pages/login/index'
							});
						} else if (res.cancel) {
							console.log('用户点击取消');
						}
					}
				});
				return false;
			}
			if (e == 'ytxs') {
				uni.navigateTo({
					url: '/pagesB/msysDB/ytxs/index/index'
				});
			}

			if (e == 'ytgk') {
				uni.navigateTo({
					url: '/pagesB/msysDB/msjz/index/index?repUserId=1'
				});
			}

			if (e == 'msxs') {
				uni.navigateTo({
					url: '/pagesB/msysDB/ytxsZ/index/index'
				});
			}

			if (e == 'jggk') {
				uni.navigateTo({
					url: '/pagesB/msysDB/jggk/index/index'
				});
			}

			if (e == 'yttj') {
				uni.navigateTo({
					url: '/pagesB/msysDB/yttj/index/index'
				});
			}

			if (e == 'qzwtlb') {
				uni.navigateTo({
					url: '/pagesB/msys/wtlb/list'
				});
			}

			if (e == 'qzmsly') {
				uni.navigateTo({
					url: '/pagesB/msys/msjz/index/index'
				});
			}

			if (e == 'qzmsys') {
				uni.navigateTo({
					url: '/pagesB/msys/msys/index/index'
				});
			}

			if (e == 'qzmsgk') {
				uni.navigateTo({
					url: '/pagesB/msys/jggs/index/index'
				});
			}

			if (e == 'qztbwt') {
				uni.navigateTo({
					url: '/pagesB/msys/tbwt/tbwt'
				});
			}
		},
		perform() {
			if (this.$sysMenus('perform_info')) {
				uni.navigateTo({
					url: '/pagesA/duties/self'
				});
			} else {
				uni.navigateTo({
					url: '/pagesA/duties/index'
				});
			}
		},
		tabsChange(index) {
			this.current = index;
		},
		swiperClick(index) {
			// this.current = index;
			// if (this.swiperList[index].id) {
			// 	uni.navigateTo({
			// 		url: '/pagesA/banner/detail?id=' + this.swiperList[index].id
			// 	});
			// }
		},
		scan() {
			uni.scanCode({
				onlyFromCamera: true,
				success: (res) => {
					this.qrcodeResult(res);
				}
			});
			// this.show = true;
		},
		qrcodeResult(res) {
			try {
				let resulet = JSON.parse(res.result);
				if (resulet.type == 'huiyi') {
					let typeMap = {
						1: '扫码签到',
						2: '刷脸签到',
						3: '手动签到',
						4: '代为签到'
					};
					let data = {
						signType: '1',
						meetingId: resulet.data.id,
						userId: this.userId
					};
					this.$request('/huiyihuodong/hyhd-meeting-user/signTime', data, {
						load: true
					}).then((res) => {
						this.meetingInfo = res.data;
						if (!res.data.firstSign) {
							this.show2 = true;
							// uni.showModal({
							// 	title: '已通过' + typeMap[res.data.signType],
							// 	content: '签到时间：' + res.data.signTime,
							// 	complete: () => {}
							// });
						} else {
							this.show = true;
						}
					});
				} else if (resulet.type == 'xsys') {
					let data = {
						consultSign: {
							infoid: resulet.data.id,
							userId: this.userId,
							userName: this.userName
						}
					};
					this.$request('/xieshangyishi/consultSign/sign/add', data, {
						load: true
					}).then((res) => {
						this.$msg('签到成功！');
					});
				} else if (resulet.type == 'loginQr') {
					let data = {
						step: '3',
						qrId: resulet.data.id,
						userId: this.userId
					};
					this.$request('/loginQr', data, {
						load: true
					}).then((res) => {
						uni.navigateTo({
							url: '/pages/login/qrcode?qrId=' + resulet.data.id
						});
					});
				} else {
					this.$msg(resulet);
				}
			} catch (e) {
				this.$msg('扫码失败！');
			}
		},
		newsTo(src) {
			let url = '/pagesA/news/news?src=' + encodeURIComponent(src);
			uni.navigateTo({
				url: url
			});
		},
		navTo(url) {
			if (this.userInfo.sysUser) {
				uni.navigateTo({
					url: url
				});
			} else {
				this.$store.commit('logout');
				uni.showModal({
					title: '提示',
					content: '请先登录？',
					success: (res) => {
						if (res.confirm) {
							uni.navigateTo({
								url: '/pages/login/index'
							});
						} else if (res.cancel) {
							console.log('用户点击取消');
						}
					}
				});
			}
		}
	}
};
</script>

<style lang="less">
.banner {
	position: relative;
	padding: 20rpx 30rpx;
	min-height: 280rpx;
	z-index: 10;
	background-color: #fff;
}

.notice-bar {
	display: block;
	margin-bottom: 20rpx;
}

.container {
	background-color: #fff;
}

.com-h3 {
	border-bottom: 20rpx solid #fff;
}

.index-card {
	background-color: #fff;

	.card-link {
		.image {
			margin: 0 auto;
			width: 76rpx;
			height: 76rpx;
		}

		.link-item {
			position: relative;
			margin-bottom: 30rpx;
			font-size: 12px;
			line-height: 34rpx;
			text-align: center;
			word-break: keep-all;
		}

		.link-item2 {
			margin-bottom: 40rpx;
			font-size: 12px;
			line-height: 34rpx;
			text-align: center;
			word-break: keep-all;

			position: relative;
			top: -30upx;

			.inimage {
				position: relative;
				top: 7upx;
				left: 5upx;
			}
		}
	}
}

.p-popup {
	position: fixed;
	left: 0;
	top: 0;
	right: 0;
	bottom: 0;
	z-index: 1000;
	background: rgba(0, 0, 0, 0.59);

	.image-box {
		position: relative;
		margin: 0 auto;
		padding-top: 252rpx;
		width: 588rpx;

		.bg-image {
			position: absolute;
			left: 0;
			top: 0;
			right: 0;
			width: 588rpx;
		}

		.image {
			width: 588rpx;
		}

		.content {
			position: relative;
			z-index: 11;
			text-align: center;
		}

		.info {
			min-height: 150rpx;
			border-left: 14rpx solid #ffeece;
			border-right: 14rpx solid #ffeece;
			background: #fff repeat-y center top;
			background-image: url('~@/static/img/bg-p_03.png');
			background-size: 100% auto;
			background-origin: border-box;
		}

		.title {
			margin: 0 30rpx 84rpx;
			min-height: 100rpx;
			font-size: 18px;
			color: #d0021b;
			line-height: 50rpx;
		}

		.name {
			margin: 0 30rpx 30rpx;
			font-size: 15px;
			color: #792d28;
			line-height: 42rpx;
		}

		.text {
			padding: 0 30rpx 10rpx;
			font-size: 14px;
			font-weight: bold;
			color: #666;
			line-height: 36rpx;
		}
	}
}
</style>
